﻿namespace IDEAMS.model.device
{
    public class DeviceParamViewModel : ViewModelBase
    {
        private string m_type;
        public string type
        {
            get { return m_type; }
            set
            {
                if (value != m_type)
                {
                    m_type = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private string m_serialNo;
        public string serialNo
        {
            get { return m_serialNo; }
            set
            {
                if (value != m_serialNo)
                {
                    m_serialNo = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private string m_version;
        public string version
        {
            get { return m_version; }
            set
            {
                if (value != m_version)
                {
                    m_version = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private string m_ip;
        public string ip
        {
            get { return m_ip; }
            set
            {
                if (value != m_ip)
                {
                    m_ip = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private int m_port;
        public int port
        {
            get { return m_port; }
            set
            {
                if (value != m_port)
                {
                    m_port = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private string m_mac;
        public string mac
        {
            get { return m_mac; }
            set
            {
                if (value != m_mac)
                {
                    m_mac = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private string m_destIP;
        public string destIP
        {
            get { return m_destIP; }
            set
            {
                if (value != m_destIP)
                {
                    m_destIP = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private int m_destPort;
        public int destPort
        {
            get { return m_destPort; }
            set
            {
                if (value != m_destPort)
                {
                    m_destPort = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private double m_temperature;
        public double temperature
        {
            get { return m_temperature; }
            set
            {
                if (value != m_temperature)
                {
                    m_temperature = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private int m_startFlag;
        public int startFlag
        {
            get { return m_startFlag; }
            set
            {
                if (value != m_startFlag)
                {
                    m_startFlag = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private int m_nChannel;
        public int nChannel
        {
            get { return m_nChannel; }
            set
            {
                if (value != m_nChannel)
                {
                    m_nChannel = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private string m_netmask;
        public string netmask
        {
            get { return m_netmask; }
            set
            {
                if (value != m_netmask)
                {
                    m_netmask = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private string m_gateway;
        public string gateway
        {
            get { return m_gateway; }
            set
            {
                if (value != m_gateway)
                {
                    m_gateway = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private byte m_reportFlag;
        public byte reportFlag
        {
            get { return m_reportFlag; }
            set
            {
                if (value != m_reportFlag)
                {
                    m_reportFlag = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private string m_reportServerIP1;
        public string reportServerIP1
        {
            get { return m_reportServerIP1; }
            set
            {
                if (value != m_reportServerIP1)
                {
                    m_reportServerIP1 = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private int m_reportServerPort1;
        public int reportServerPort1
        {
            get { return m_reportServerPort1; }
            set
            {
                if (value != m_reportServerPort1)
                {
                    m_reportServerPort1 = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private string m_reportServerIP2;
        public string reportServerIP2
        {
            get { return m_reportServerIP2; }
            set
            {
                if (value != m_reportServerIP2)
                {
                    m_reportServerIP2 = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private int m_reportServerPort2;
        public int reportServerPort2
        {
            get { return m_reportServerPort2; }
            set
            {
                if (value != m_reportServerPort2)
                {
                    m_reportServerPort2 = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private string m_reportServerIP3;
        public string reportServerIP3
        {
            get { return m_reportServerIP3; }
            set
            {
                if (value != m_reportServerIP3)
                {
                    m_reportServerIP3 = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private int m_reportServerPort3;
        public int reportServerPort3
        {
            get { return m_reportServerPort3; }
            set
            {
                if (value != m_reportServerPort3)
                {
                    m_reportServerPort3 = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private uint m_timeInterval;
        public uint timeInterval
        {
            get { return m_timeInterval; }
            set
            {
                if (value != m_timeInterval)
                {
                    m_timeInterval = value;
                    NotifyPropertyChanged();
                }
            }
        }

        public DeviceParamViewModel() { }

        public DeviceParamViewModel(DeviceParam info)
        {
            Copy(info);
        }
        public DeviceParamViewModel(DeviceParamViewModel info)
        {
            Copy(info);
        }

        public void Copy(DeviceParam info)
        {
            this.type = info.type;
            this.serialNo = info.serialNo;
            this.version = info.version;
            this.ip = info.ip;
            this.port = info.port;
            this.mac = info.mac;
            this.destIP = info.destIP;
            this.destPort = info.destPort;
            this.temperature = info.temperature;
            this.startFlag = info.startFlag;
            this.nChannel = info.nChannel;
            this.netmask = info.netmask;
            this.gateway = info.gateway;
            this.reportFlag = info.reportFlag;
            this.reportServerIP1 = info.reportServerIP1;
            this.reportServerPort1 = info.reportServerPort1;
            this.reportServerIP2 = info.reportServerIP2;
            this.reportServerPort2 = info.reportServerPort2;
            this.reportServerIP3 = info.reportServerIP3;
            this.reportServerPort3 = info.reportServerPort3;
            this.timeInterval = info.timeInterval;
        }
        public void Copy(DeviceParamViewModel info)
        {
            this.type = info.type;
            this.serialNo = info.serialNo;
            this.version = info.version;
            this.ip = info.ip;
            this.port = info.port;
            this.mac = info.mac;
            this.destIP = info.destIP;
            this.destPort = info.destPort;
            this.temperature = info.temperature;
            this.startFlag = info.startFlag;
            this.nChannel = info.nChannel;
            this.netmask = info.netmask;
            this.gateway = info.gateway;
            this.reportFlag = info.reportFlag;
            this.reportServerIP1 = info.reportServerIP1;
            this.reportServerPort1 = info.reportServerPort1;
            this.reportServerIP2 = info.reportServerIP2;
            this.reportServerPort2 = info.reportServerPort2;
            this.reportServerIP3 = info.reportServerIP3;
            this.reportServerPort3 = info.reportServerPort3;
            this.timeInterval = info.timeInterval;
        }

        public DeviceParamViewModel Clone()
        {
            return new DeviceParamViewModel(this);
        }
    }
}
